package com.yanqu.road.entity.activity.stronghold;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.player.UserBaseInfo;
import com.yanqu.road.entity.player.UserPatrons;

import java.math.BigInteger;

/**
 * 淘汰赛防守门客
 */
@FieldTypeAnnotation(tableName = "t_u_activity_stronghold_eliminate_patrons")
public class StrongholdEliminateDefendPatrons extends DataObject {
    @FieldTypeAnnotation(select = true, update = true, desc = "活动id")
    private int activityId;
    @FieldTypeAnnotation(update = true, desc = "玩家id")
    private long userId;
    @FieldTypeAnnotation(update = true, desc = "联盟id")
    private String unionUid="";
    @FieldTypeAnnotation(desc = "玩家信息")
    private UserBaseInfo userBaseInfo = new UserBaseInfo();
    @FieldTypeAnnotation(desc = "赚钱速度")
    private BigInteger earnSpeed = BigInteger.ZERO;
    @FieldTypeAnnotation(desc = "总血量")
    private BigInteger totalBlood = BigInteger.ZERO;
    @FieldTypeAnnotation(desc = "门客信息")
    private UserPatrons patrons;
    private int patronsSite;


    public int getActivityId() {
        return activityId;
    }

    public long getUserId() {
        return userId;
    }

    public String getUnionUid() {
        return unionUid;
    }

    public UserBaseInfo getUserBaseInfo() {
        return userBaseInfo;
    }

    public BigInteger getEarnSpeed() {
        return earnSpeed;
    }

    public BigInteger getTotalBlood() {
        return totalBlood;
    }

    public UserPatrons getPatrons() {
        return patrons;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }

    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }

    }

    public void setUnionUid(String unionUid) {
        if (null == unionUid) {
            return;
        }
        if (!this.unionUid.equals(unionUid)) {
            this.unionUid = unionUid;
            setOp(DataStatus.Update);
        }
    }

    public void setEarnSpeed(BigInteger earnSpeed) {
        if (null == earnSpeed) {
            return;
        }
        if (!this.earnSpeed.equals(earnSpeed)) {
            this.earnSpeed = earnSpeed;
            setOp(DataStatus.Update);
        }
    }

    public void setTotalBlood(BigInteger totalBlood) {
        if (null == totalBlood) {
            return;
        }
        if (!this.totalBlood.equals(totalBlood)) {
            this.totalBlood = totalBlood;
            setOp(DataStatus.Update);
        }
    }

    public int getPatronsSite() {
        return patronsSite;
    }

    public void setPatronsSite(int patronsSite) {
        this.patronsSite = patronsSite;
    }

    public void setUserBaseInfo(UserBaseInfo userBaseInfo) {
        this.userBaseInfo = userBaseInfo;
    }

    public void setPatrons(UserPatrons patrons) {
        this.patrons = patrons;
    }

    public StrongholdEliminateDefendPatrons clonePatrons() {
        StrongholdEliminateDefendPatrons patrons = new StrongholdEliminateDefendPatrons();
        patrons.setActivityId(this.activityId);
        patrons.setPatrons(this.patrons.cloneUserPatrons());
        patrons.setUserId(this.userId);
        patrons.setUserBaseInfo(this.userBaseInfo);
        patrons.setUnionUid(this.unionUid);
        patrons.setEarnSpeed(this.earnSpeed);
        patrons.setTotalBlood(this.totalBlood);
        patrons.setPatronsSite(this.patronsSite);
        return patrons;
    }
}
